#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat

FROM microsoft/dotnet:2.2-aspnetcore-runtime-nanoserver-sac2016 AS base
WORKDIR /app
EXPOSE 80

FROM microsoft/dotnet:2.2-sdk-nanoserver-sac2016 AS build
WORKDIR /src
COPY ["src/AbpProject.Web.Host/AbpProject.Web.Host.csproj", "src/AbpProject.Web.Host/"]
COPY ["src/AbpProject.Web.Core/AbpProject.Web.Core.csproj", "src/AbpProject.Web.Core/"]
COPY ["src/AbpProject.EntityFrameworkCore/AbpProject.EntityFrameworkCore.csproj", "src/AbpProject.EntityFrameworkCore/"]
COPY ["src/AbpProject.Core/AbpProject.Core.csproj", "src/AbpProject.Core/"]
COPY ["src/AbpProject.Application/AbpProject.Application.csproj", "src/AbpProject.Application/"]
RUN dotnet restore "src/AbpProject.Web.Host/AbpProject.Web.Host.csproj"
COPY . .
WORKDIR "/src/src/AbpProject.Web.Host"
RUN dotnet build "AbpProject.Web.Host.csproj" -c Release -o /app

FROM build AS publish
RUN dotnet publish "AbpProject.Web.Host.csproj" -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "AbpProject.Web.Host.dll"]